package com.topit.show.wxapi.vo;

import java.io.Serializable;

public class JsApiTicket implements Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = -1927527986948735842L;
	// 获取到的凭证
    private String ticket;
    // 凭证有效时间，单位：秒
    private long expires_in;

    //获取token的时间
    private long getTime;

    public String getTicket() {
        return ticket;
    }

    public void setTicket(String ticket) {
        this.ticket = ticket;
    }

    public long getExpires_in() {
        return expires_in;
    }

    public void setExpires_in(long expires_in) {
        this.expires_in = expires_in;
    }

    public long getGetTime() {
        return getTime;
    }

    public void setGetTime(long getTime) {
        this.getTime = getTime;
    }

    public boolean isExpires() {
        return System.currentTimeMillis() - getTime > expires_in * 1000;
    }

    @Override
    public String toString() {
        return "JsApiTicket [jsapi_ticket=" + ticket + ", expiresIn=" + expires_in + ", isExpires=" + isExpires() + "]";
    }
}
